import Dispatcher from "./server/Dispatcher"
import * as path from "path"
import * as http from "http"
import {createConnection} from "typeorm"
import {getLogger} from "log4js"


createConnection().then(() => {
  const dispatcher = new Dispatcher(path.resolve(__dirname, "workdir"))
  const server = http.createServer()
  server.listen(8090).on("request", (req, res) => {
    dispatcher.doDispatch(req, res)
  }).on("listening", () => {
    getLogger("App").info("http://localhost:8090")
  })
})


